<%-- 
    Document   : post-update
    Created on : 27-02-2012, 21:55:10
    Author     : NHAN
--%>


<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fck" uri="http://java.fckeditor.net" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Post Update</title>
    </head>

    <body>
        <h1>Post update</h1>
        <form action="PostsAction.do?method=update" method="post">
            <input type="hidden" name="id" value="${post.id}"/>
            <table class="form-table">
                <tr>
                    <td>Title</td>
                    <td><input type="text" name="title"/></td>
                    <td></td>
                </tr>
                <tr>
                    <td>Content: </td>
                    <td>
                        <fck:editor instanceName="defaultEditor" height="300" inputName="content" value="${post.content}"/>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>Category: </td>
                    <td>
                        <select name="category">
                            <c:forEach var="cat" items="${cateList}">
                                <option value="${cat.id}">${cat.name}</option>
                            </c:forEach>
                        </select>
                    </td>
                    <td></td>
                </tr>                 
                <tr>
                    <td>State</td>
                    <td><input type="checkbox" name="is-public" value="${post.state}"/></td>
                    <td></td>
                </tr> 
                <tr>
                    <td></td>
                    <td><input type="submit" value="Save changes"/></td>
                    <td></td>
                </tr>
            </table>
        </form>
        <form action="PostAction.do?action=delete" method="post">
            <input type="hidden" name="selected-item-id" id="selected-item-id"/>
            <div class="confirm-box">
                <div>Are you sure want to continue?</div>
                <input type="button" name="delete" value="Delete" onclick="remove();"/>
                <input type="button" name="hide" value="Cancel" onclick="hideConfirm();"/>
            </div>
            <input type="hidden" name="id" value="${post.id}"/>
        </form>
    </body>
</html>
